
import diyclassloader.MyUserClassLoader1;
import diyclassloader.MyUserClassLoader2;
import jdk.nashorn.internal.codegen.Namespace;
import pojo.Student;
import pojo.User;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : example
 * @ Author: XuLeHuang
 * @ Date: 2022/12/22 11:09
 * @ Description:
 */
public class Test {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        MyUserClassLoader1 myUserClassLoader1 = new MyUserClassLoader1();
        MyUserClassLoader2 myUserClassLoader2 = new MyUserClassLoader2();
        Class<?> aClass1 = myUserClassLoader1.loadClass("pojo.User");
        Class<?> aClass2 = myUserClassLoader2.loadClass("pojo.Student");
        User user = (User)aClass1.newInstance();
        //Student student = (Student)aClass2.newInstance();
    }
}
